package com.xbb.controller.wedding;

import com.xbb.bean.Wedding;
import com.xbb.dao.WeddingMapperDao;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by xbb on 15/7/24.
 */
@Controller
public class WeddingController {

    @Resource
    private WeddingMapperDao dao;

    @RequestMapping("get_blessings")
    @ResponseBody
    public List<Wedding> getBlessings(Model model){
        List<Wedding> blessings = dao.getBlessings();
        return blessings;
    }

    @RequestMapping("set_blessings")
    @ResponseBody
    public String setBlessing(String blessing){
        System.out.println(blessing);
        dao.setBlessing(blessing);
        return "success";
    }

}
